import request from '@/utils/request'

// 列表
export const stockPageList = (data) => {
  return request({
    url: '/wms-stock-change/page-list',
    method: 'post',
    data
  })
}

// 仓库列表
export const warehousePageList = (data) => {
  return request({
    url: '/code-warehouse/page-list-all',
    method: 'post',
    data
  })
}

//库存查询列表
export const stokcPageList = (data) => {
  return request({
    url: '/wms-stock/page-list',
    method: 'post',
    data
  })
}

// 入库列表
export const pageInstoreList = (data) => {
  return request({
    url: '/wms-store-apply/page-instore-list',
    method: 'post',
    data
  })
}

// 出库列表
export const pageOutstoreList = (data) => {
  return request({
    url: '/wms-store-apply/page-outstore-list',
    method: 'post',
    data
  })
}

// 入库确认
export const inStoreConfirm = (data) => {
  return request({
    url: `/wms-store-apply/inStoreConfirm/${data.id}`,
    method: 'post',
    data
  })
}

// 退货确认
export const tuiHuoConfirm = (data) => {
  return request({
    url: `/wms-store-apply/tuiHuoConfirm/${data.id}?huiHuoBillNo=${data.huiHuoBillNo}`,
    method: 'post'
  })
}

//获取销售订单商品数量
export const wmsStoreApplyBatchNumberList = (id) => {
  return request({
    url: `/wms-store-apply/batchNumberList/${id}`,
    method: 'post'
  })
}

// 仓库管理列表
export const codeWarehousePageList = (data) => {
  return request({
    url: '/code-warehouse/page-list',
    method: 'post',
    data
  })
}

// 仓库管理修改
export const codeWarehouseModify = (data) => {
  return request({
    url: '/code-warehouse/modify',
    method: 'post',
    data
  })
}

// 仓库管理启用
export const codeWarehouseEnable = (id) => {
  return request({
    url: `/code-warehouse/enable/${id}`,
    method: 'post'
  })
}

// 仓库管理禁用
export const codeWarehouseDisable = (id) => {
  return request({
    url: `/code-warehouse/disable/${id}`,
    method: 'post'
  })
}

// 仓库管理新增
export const codeWarehouseAdd = (data) => {
  return request({
    url: '/code-warehouse/add',
    method: 'post',
    data
  })
}

// 生成送货单
export const generalSendGoodsBill = (idList,downloadMode) => {
  return request({
    url: `/wms-store-apply/generalSendGoodsBill?idList=${idList}&downloadMode=${downloadMode}`,
    method: 'post',
    responseType: 'blob'
  })
}

// 出库确认
export const outStoreConfirm = (data) => {
  return request({
    url: '/wms-store-apply/outStoreConfirm',
    method: 'post',
    data
  })
}

// 全部商品
export const codeMaterialListAll = (data) => {
  return request({
    url: `/code-material/listAll`,
    method: 'post',
    data
  })
}

//新增调拨入库
export const wmsStoreApplyAdd = (data) => {
  return request({
    url: `/wms-store-apply/add`,
    method: 'post',
    data
  })
}

//库存明细
export const wmsStockDetail = (data) => {
  return request({
    url: `/wms-stock/detail`,
    method: 'post',
    data
  })
}

export const wmsStockWareHouseList = (id,inOut) => {
  return request({
    url: `/wms-stock/warehouse-list?materialId=${id}&inOut=${inOut}`,
    method: 'post'
  })
}

export const wmsStockChangeInStoreList = (data) => {
  return request({
    url: `/wms-stock-change/in_store_list`,
    method: 'post',
    data
  })
}

export const wmsStockApplyChangeList = (id,inOut) => {
  return request({
    url: `/wms-store-apply/applyChangeList/${id}?inOut=${inOut}`,
    method: 'post'
  })
}

export const wmsStockApplyExportInStoreExcel = (data) => {
  return request({
    url: '/wms-store-apply/exportInStoreExcel',
    method: 'post',
    responseType: 'blob',
    data
  })
}

// 仓库帐面库存汇总
export const wmsStockPageAccountList = (data) => {
  return request({
    url: `/wms-stock/page-account-list`,
    method: 'post',
    data
  })
}

// 仓库帐面库存汇总-明细
export const wmsStockChangeDetailList = (data) => {
  return request({
    url: `/wms-stock-change/detail_list`,
    method: 'post',
    data
  })
}


// 仓库帐面库存汇总-导出
export const wmsStockExportStoreAccountExcel = (data) => {
  return request({
    url: '/wms-stock/exportStoreAccountExcel',
    method: 'post',
    responseType: 'blob',
    data
  })
}

// 仓库帐面库存汇总-明细导出
export const wmsStockChangeExportExcel = (data) => {
  return request({
    url: '/wms-stock-change/exportExcel',
    method: 'post',
    responseType: 'blob',
    data
  })
}

// 销售开票
export const accBillingSellOrder = (params) => {
  return request({
    url: `/acc/billingSellOrder`,
    method: 'get',
    params
  })
}

// 采购开票
export const accBillingScmOrder = (params) => {
  return request({
    url: `/acc/billingScmOrder`,
    method: 'get',
    params
  })
}

// 发货单生成对账单
export const accBindSellStatement = (data) => {
  return request({
    url: '/acc/bindSellStatement',
    method: 'post',
    data
  })
}

// 入库单生成对账单
export const accBindBuyStatement = (data) => {
  return request({
    url: '/acc/bindBuyStatement',
    method: 'post',
    data
  })
}

// 出库对账单管理
export const accSellStatementList = (params) => {
  return request({
    url: `/acc/sellStatementList`,
    method: 'get',
    params
  })
}

// 删除出库对账单
export const accDeleteSellStatement = (params) => {
  return request({
    url: `/acc/deleteSellStatement`,
    method: 'get',
    params
  })
}

// 入库对账单管理
export const accBuyStatementList = (params) => {
  return request({
    url: `/acc/buyStatementList`,
    method: 'get',
    params
  })
}

// 删除入库对账单
export const accDeleteBuyStatement = (params) => {
  return request({
    url: `/acc/deleteBuyStatement`,
    method: 'get',
    params
  })
}

// 对账单开票
export const accGenerateBuyInvoice = (params) => {
  return request({
    url: `/acc/generateBuyInvoice`,
    method: 'get',
    params
  })
}

// 出库对账单
export const wmsStoreApplySellStatementList = (data) => {
  return request({
    url: `/wms-store-apply/sellStatementList`,
    method: 'post',
    data
  })
}

// 入库对账单
export const wmsStoreApplyBuyStatementList = (data) => {
  return request({
    url: `/wms-store-apply/buyStatementList`,
    method: 'post',
    data
  })
}

export const wmsStoreApplyGeneralGoodsReceivedNote = (id) => {
  return request({
    url: `/wms-store-apply/generalGoodsReceivedNote/${id}`,
    method: 'post',
    responseType: 'blob'
  })
}

// 出库对账单导出明细
export const accDetail2Export = (data) => {
  return request({
    url: `/acc/exportSellStatements`,
    method: 'post',
    responseType: 'blob',
    data
  })
}

// 入库对账单导出明细
export const accDetail1Export = (data) => {
  return request({
    url: `/acc/exportBuyStatementList`,
    method: 'post',
    responseType: 'blob',
    data
  })
}


export const wmsStoreApplyDel = (id) => {
  return request({
    url: `/wms-store-apply/delete/${id}`,
    method: 'post'
  })
}





















